<template>
  <el-dialog
    :destroy-on-close="false"
    :show-close="false"
    v-model="dialogVisible"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    align-center
    width="430"
  >
    <div class="add-classification-folder">
      <img class="close" @click="close" src="~/assets/img/close.png" alt="" />
      <div class="header">新增分组</div>
      <div class="box">
        <div class="title">分组类型</div>
        <div class="list">
          <div class="icon active">
            <img src="~@/assets/img/wjj.png" alt="" />
          </div>
          <div class="icon">
            <img src="~@/assets/img/bgb.png" alt="" />
          </div>
          <div class="icon">
            <img src="~@/assets/img/sj.png" alt="" />
          </div>
          <div class="icon">
            <img src="~@/assets/img/xz.png" alt="" />
          </div>
          <div class="icon">
            <img src="~@/assets/img/yx.png" alt="" />
          </div>
          <div class="icon">
            <img src="~@/assets/img/gw.png" alt="" />
          </div>
          <div class="icon">
            <img src="~@/assets/img/yy.png" alt="" />
          </div>
          <div class="icon">
            <img src="~@/assets/img/dy.png" alt="" />
          </div>
          <div class="icon">
            <img src="~@/assets/img/gr.png" alt="" />
          </div>
          <div class="icon">
            <img src="~@/assets/img/ly.png" alt="" />
          </div>
        </div>
        <div class="title">分组名称</div>
        <div class="name">
          <el-input v-model="name" placeholder="请输入分组名称" maxlength="8"></el-input>
        </div>  
        <div class="footer">
          <el-button class="cancel" @click="close">取消</el-button>
          <el-button class="confirm" @click="close">添加</el-button>
        </div>
      </div>
    </div>
  </el-dialog>
</template>

<script setup>
const name = ref('')
const dialogVisible = ref(false);
const close = () => {
  dialogVisible.value = false;
};
const show = () => {
  dialogVisible.value = true;
};
defineExpose({
  close,
  show,
});
</script>

<style lang="scss" scoped>
.add-classification-folder {
  background: #ffffff;
  border-radius: 10px;
  position: relative;
  .close {
    width: 20px;
    height: 20px;
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
  }
  .header {
    height: 68px;
    background: #f0fbf9;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 10px 10px 0 0;
  }
  .box {
    padding: 30px 20px 20px 20px;
    .title {
      font-size: 16px;
      font-weight: 500;
      text-align: LEFT;
      color: #333333;
      margin: 10px 0;
    }
    .list {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 10px;
      margin-bottom: 30px;
      .icon {
        width: 60px;
        height: 60px;
        background: #f4f4f4;
        border-radius: 5px;
        display: flex;
        justify-content: center;
        align-items: center;
        > img {
          width: 28px;
          height: 28px;
        }
      }
      .icon.active {
        background: #32c7aa;
      }
    }
    .name {
      width: 340px;
      height: 46px;
      background: #f4f4f4;
      border-radius: 5px;
      margin: 0 auto;
      padding: 10px;
      font-size: 16px;
      font-weight: 500;
      color: #999999;
    }
    .footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 20px;
      ::v-deep .el-button.cancel {
        width: 277px;
        height: 52px;
        background: #D8E7E4;
        border-radius: 5px;
        font-size: 16px;
        font-weight: 400;
        text-align: center;
        color: #32C7AA;
      }
      ::v-deep .el-button.confirm {
        width: 277px;
        height: 52px;
        background: #32C7AA;
        border-radius: 5px;
        font-size: 16px;
        font-weight: 400;
        text-align: center;
        color: #fff;
      }
    }
  }
}
</style>
